/**
 * Created by rock on 15/6/10.
 */

//detect mobile
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
//    window.location.href = 'http://apps.jk.cn/downloadpage/releases/211/wap/index.html';
    window.location.href = 'http://dp.jk.cn';
}

//detect IE9 below
var ie = (function(){

    var undef,
        v = 3,
        div = document.createElement('div'),
        all = div.getElementsByTagName('i');

    while (
        div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',
            all[0]
        );

    return v > 4 ? v : undef;

}());

if ( ie < 9 ) {
    window.location.href = 'http://apps.jk.cn/health_web/index.html';
}

function imgSizeFix(str,width,height){
    var final_str;
    final_str = str.substring(0,str.lastIndexOf("."));
    final_str += '_'+width+'x'+height;
    final_str += str.substring(str.lastIndexOf("."),str.lenght)
    return final_str;
}
